NC Rock Type Map

The State’s Interactive Geology Map has several visualizations including Rock Units, Physiographic Provinces, and Terranes and Major Features. Below, the same data are displayed based on Rock Type.

Data

rm(list=ls())
library(leaflet)
library(rmarkdown)
library(dplyr)
library(viridis)
library(leaflet.extras)

## code here
geol <- readRDS("geol.RDS")

fpal <- colorFactor(c(viridis(5,)[1], viridis(5)[2], viridis(5)[2],
                      viridis(5)[3], viridis(5)[4], viridis(5)[5]), geol$TYPE)
## fpal <- colorFactor(viridis(6), geol$TYPE)

p1 <- leaflet(geol) %>%
    addProviderTiles(providers$OpenStreetMap.Mapnik) %>%
    addPolygons(stroke = FALSE, smoothFactor = 0.2, fillOpacity = 1,
                color = ~fpal(TYPE),
                popup=paste(sep="<br/>",geol$TYPE, geol$GEOCODE,geol$DESCRIP_1)) %>%
    addFullscreenControl()

p1